#-*- coding:utf-8 -*-
from appium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By

def find_toast(message,driver):

	try:
		message = '//*[@text=\'{}\']'.format(message)
		element = WebDriverWait(driver,10,0.5).until(EC.presence_of_element_located((By.XPATH,message)))

		return True
	except Exception, e:
		return False